package com.ly.controller;

import com.ly.pojo.PromotionAd;
import com.ly.service.PromotionAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/promotionAd")
@CrossOrigin
public class PromotionAdController {
    @Autowired
    private PromotionAdService promotionAdService;

    @GetMapping("/findAdBySpaceId/{spaceId}")
    public List<PromotionAd> findAdBySpaceId(@PathVariable("spaceId") Integer spaceId){
        return promotionAdService.findAdBySpaceId(spaceId);
    }

}
